package com.dxlau.service.impl;

import com.dxlau.service.IPersonService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

/**
 * Created by dxlau on 16/8/30.
 */
@Service
public class PersonServiceImpl implements IPersonService {

    private static final Logger logger = LoggerFactory.getLogger(PersonServiceImpl.class);

    @Autowired
    RedisTemplate redisTemplate;

    @Override
    public Boolean addPerson() {
        logger.info("PersonServiceImpl Set redis");
        redisTemplate.opsForValue().set("person", "dxlau");
        redisTemplate.opsForValue().set("person1", "dxlau1");
        logger.info("GET person: {}.", redisTemplate.opsForValue().get("person"));
        logger.info("GET person1: {}.", redisTemplate.opsForValue().get("person1"));
        return null;
    }
}
